include $(C2C_BASE_PATH)/comm/makefile.comm.v2

CPPFLAGS +=-D__SVC_CNTL_2__
INCLUDE = -I../include \
		  -I$(INC_AUCTION_PATH) \
		  -I$(C2C_BASE_PATH)/comm/export_include \
		  -I$(C2C_BASE_PATH)/comm/export_include/libc2c \
		  -I$(C2C_BASE_PATH)/comm/export_include/app_platform \
		  $(INC_MYSQL) \
		  -I../XXO

INSTALL_PATH = $(LIB_AUCTION_PATH)
INSTALL_PATH_INC = $(INC_AUCTION_PATH)/erp/storage/dao/

LIB =

OUTPUT  = libstoragedao_stub.a
OUTPUT_STUB4WEB  = libstoragedao_stub4web.a
OUTPUT_STUB4WEB_R  = libstoragedao_stub4web_r.a

SOURCES = storagedao_stub4app.cpp storagedao_factory.cpp
OBJECTS=$(SOURCES:.cpp=.o)

SOURCES_STUB4WEB = storagedao_stub4web.cpp
OBJECTS_STUB4WEB=$(SOURCES_STUB4WEB:.cpp=.o)

SOURCES_STUB4WEB_R = storagedao_stub4web_r.cpp
OBJECTS_STUB4WEB_R=$(SOURCES_STUB4WEB_R:.cpp=.o)

all:$(OUTPUT) $(OUTPUT_STUB4WEB) $(OUTPUT_STUB4WEB_R)

.SUFFIXES: .o .cpp
.cpp.o:
	$(CXX) $(CPPFLAGS) $(INCLUDE) -c $(filter %.cpp, $^) 

.o:
	$(CXX) $(CPPFLAGS) $(INCLUDE) -o $@ $^

$(OUTPUT):$(OBJECTS)
	ar -rs $@ $^

$(OUTPUT_STUB4WEB):$(OBJECTS_STUB4WEB)
	ar -rs $@ $^

$(OUTPUT_STUB4WEB_R):$(OBJECTS_STUB4WEB_R)
	ar -rs $@ $^

install:	
	mkdir -p $(INSTALL_PATH)
	cp -f $(OUTPUT) $(OUTPUT_STUB4WEB) $(OUTPUT_STUB4WEB_R) $(INSTALL_PATH)
	mkdir -p $(INSTALL_PATH_INC)
	cp -f ../lib/storagedao_stub4app.h $(INSTALL_PATH_INC)
	cp -f ../lib/storagedao_stub4web.h $(INSTALL_PATH_INC)
	cp -f ../lib/storagedao_req_resp.h $(INSTALL_PATH_INC)
	cp -f ../include/storagedao_factory.h $(INSTALL_PATH_INC)
	cp -f ../include/intf_storagedao.h $(INSTALL_PATH_INC)
	cp -f ../include/mock_storagedao.h $(INSTALL_PATH_INC)
	cp -f ../include/storagedao_stub4web_allinone.h $(INSTALL_PATH_INC)

clean:
	rm -f *.o *.~ *.bak
	rm -f $(OUTPUT) $(OUTPUT_STUB4WEB) $(OUTPUT_STUB4WEB_R)

dep:
	mkdep $(INCLUDE) $(SOURCES) $(SOURCES_STUB4WEB) $(SOURCES_STUB4WEB_R) > .depend

ifneq ($(wildcard .depend),)
include .depend
endif
